﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admincp/Site.master" AutoEventWireup="true" CodeFile="Order-Payment.aspx.cs" Inherits="admincp_Order_Payment" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style>
        .layout {
            background:#00aeef;
        }
        .layout h2 { margin-left: 40px; padding-left: 0.1em; font-size: 2em; line-height: 1em; font-size:40px;
			font-family: Arial, Helvetica, sans-serif;
			color: #504f4f;
			text-shadow: 0px 2px 1px #333;
        }
        .manager {
            clear: both;
            width: 100%;
            margin-left: 10px;
            width:990px;
            padding-bottom:10px;
        }
        footer {
            clear:both;
            text-align:right;
            padding-top:30px;
            padding-bottom:20px;
            background:#0d0d0d;
        }
        .layout a{
            padding-left:20px;color:white;text-decoration:none;
        }
        .layout a:hover{
            padding-left:20px;color:#c2baba;text-decoration:none;filter: alpha(opacity=25);
        }
        .auto-style1 {
        }
        .auto-style3 {
            width: 297px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <h2>Trang Quản Lý Đặt Hàng - Thanh Toán</h2>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server">
        <ProgressTemplate>
            Đang xử lý dữ liệu...
        </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:HyperLink ID="hlOrders" Text="Quản lý đặt hàng"  runat="server" />&nbsp;
            <asp:HyperLink ID="hlOrderDetail" runat="server" Text="Chi tiết đặt hàng" ></asp:HyperLink>&nbsp;
            <asp:HyperLink ID="hlPayments" Text="Quản lý hình thức thanh toán"  runat="server" /><br />
            <asp:MultiView ID="MutiView1" ActiveViewIndex="0" runat="server">
                <asp:View ID="View1" runat="server">
                    <div class="manager">
                        <asp:Panel ID="pnOrders" runat="server" GroupingText="Mục Lập Đơn Đặt Hàng" ValidationGroup="Orders" >
                            <table>
                                <tr valign="top">
                                    <td>Tên Nhân Viên</td>
                                    <td><asp:DropDownList ID="ddlEmployees" runat="server" Width="130px">
                                        </asp:DropDownList>
                                    </td>
                                    <td>Tên Khách Hàng</td>
                                    <td><asp:DropDownList ID="ddlCustomers" runat="server" Width="130px">
                                        </asp:DropDownList>
                                    </td>
                                    <td>Ngày đặt hàng</td>
                                    <td class="auto-style3"><asp:TextBox ID="txtOrderDate" Width="130" runat="server" />
                                        <asp:ImageButton ID="Image1" ImageUrl="~/Image/Calendar_scheduleHS.png" runat="server" AlternateText="Nhấn để hiện lịch" />
                                        <asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtOrderDate" PopupButtonID="Image1"></asp:CalendarExtender>
                                    </td>
                                </tr>
                                <tr valign="top">
                                    <td>Ngày giao hàng</td>
                                    <td>
                                        <asp:TextBox ID="txtRequiredDate" Width="130" runat="server" />
                                        <asp:ImageButton ID="Image2" ImageUrl="~/Image/Calendar_scheduleHS.png" runat="server" AlternateText="Nhấn để hiện lịch" />
                                        <asp:CalendarExtender ID="CalendarExtender4" runat="server" TargetControlID="txtRequiredDate" PopupButtonID="Image2"></asp:CalendarExtender>
                                    </td>
                                    <td>Thuế VAT</td>
                                    <td><asp:TextBox ID="txtVAT" Text="10%" Width="130" ReadOnly="true" runat="server" /> </td>
                                    <td>HT Vận Chuyển</td>
                                    <td class="auto-style3">
                                        <asp:DropDownList ID="ddlFreight" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlFreight_SelectedIndexChanged">
                                            
                                        </asp:DropDownList>
                                        &nbsp;<asp:TextBox ID="txtFreight" runat="server" ReadOnly="True" Width="70px"></asp:TextBox>
                                        &nbsp;VNĐ</td>
                                </tr>
                                <tr valign="top">
                                    <td>Tên người nhận</td>
                                    <td><asp:TextBox ID="txtShipName" Width="130" runat="server" /> 
                                        <asp:RequiredFieldValidator ID="rfvShipName" runat="server" ControlToValidate="txtShipName" Display="Dynamic" ErrorMessage="Tên người nhận không được rỗng" SetFocusOnError="True" ValidationGroup="Orders">*</asp:RequiredFieldValidator>
                                    </td>
                                    <td>Địa chỉ</td>
                                    <td>
                                        <asp:TextBox ID="txtShipAddress" Width="130" runat="server" />
                                        <asp:RequiredFieldValidator ID="rfvShipAddress" runat="server" ControlToValidate="txtShipAddress" Display="Dynamic" ErrorMessage="Địa chỉ người nhận không được rỗng" SetFocusOnError="True" ValidationGroup="Orders">*</asp:RequiredFieldValidator>
                                    </td>
                                    <td>Thành Phố</td>
                                    <td class="auto-style3">
                                        <asp:TextBox ID="txtShipCity" Width="130" runat="server" />
                                        <asp:RequiredFieldValidator ID="rfvShipCity" runat="server" ControlToValidate="txtShipCity" Display="Dynamic" ErrorMessage="Thành phố người nhận không được rỗng" SetFocusOnError="True" ValidationGroup="Orders">*</asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>Mã bưu chính</td>
                                    <td>
                                        <asp:TextBox ID="txtShipPostalCode" Width="130" runat="server" />
                                        <asp:RequiredFieldValidator ID="rfvShipPostalCode" runat="server" ControlToValidate="txtShipPostalCode" Display="Dynamic" ErrorMessage="Mã bưu chính không được rỗng" SetFocusOnError="True" ValidationGroup="Orders">*</asp:RequiredFieldValidator>
                                    </td>
                                    <td>Quốc gia</td>
                                    <td colspan="3">
                                        <asp:TextBox ID="txtShipCountry" Width="130" runat="server" />
                                        <asp:RequiredFieldValidator ID="rfvShipCountry" runat="server" ControlToValidate="txtShipCountry" Display="Dynamic" ErrorMessage="Quốc gia không được rỗng" SetFocusOnError="True" ValidationGroup="Orders">*</asp:RequiredFieldValidator> 
                                    </td>
                                </tr>
                                <tr>
                                    <td>Trạng thái</td>
                                    <td colspan="5">
                                        <asp:RadioButtonList ID="rb_Status" runat="server" RepeatDirection="Horizontal" Width="300px">
                                            <asp:ListItem Value="True">Đã giao hàng</asp:ListItem>
                                            <asp:ListItem Selected="True" Value="False">Chưa giao hàng</asp:ListItem>
                                        </asp:RadioButtonList>
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel><br />
                        <asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="Orders" /><br />
                        Chú ý: Phải nhập đầy đủ thông tin khi đăng ký nhân viên<br />
                        <span class="button-met dark"><asp:Button ID="btnInsert" Text="Thêm Mới" runat="server" OnClick="btnInsert_Click" CssClass="button" BorderWidth="0px"  ValidationGroup="Orders" /></span>&nbsp;
                        <span class="button-met dark"><asp:Button ID="btnUpdate" Text="Cập Nhật" runat="server" OnClick="btnUpdate_Click" CssClass="button" BorderWidth="0px" ValidationGroup="Orders" /></span>
                        <br />
                        <br />
                        <asp:GridView ID="gvOrders" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" CellPadding="4" Width="947px" OnSelectedIndexChanging="gvOrders_SelectedIndexChanging" AllowPaging="True" OnPageIndexChanging="gvOrders_PageIndexChanging" >
                            <Columns>
                                <asp:BoundField HeaderText="STT" DataField="orderid" />
                                <asp:BoundField HeaderText="Mã NV" DataField="employeeid" />
                                <asp:BoundField HeaderText="Mã KH" DataField="customerid" />
                                <asp:BoundField HeaderText="Ngày lập" DataField="orderdate" DataFormatString="{0:MM/dd/yyyy}" />
                                <asp:BoundField HeaderText="Ngày giao" DataField="requireddate" DataFormatString="{0:MM/dd/yyyy}" />
                                <asp:TemplateField HeaderText="Trạng Thái">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Hide") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# ((Eval("Hide").ToString()=="True")?"Đã giao hàng":"Chưa giao hàng") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:CommandField SelectText="Sửa" ShowSelectButton="True" />
                            </Columns>
                            <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
                            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
                            <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
                            <RowStyle BackColor="White" ForeColor="#330099" VerticalAlign="Top" />
                            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
                            <SortedAscendingCellStyle BackColor="#FEFCEB" />
                            <SortedAscendingHeaderStyle BackColor="#AF0101" />
                            <SortedDescendingCellStyle BackColor="#F6F0C0" />
                            <SortedDescendingHeaderStyle BackColor="#7E0000" />
                        </asp:GridView>
                    </div>
                </asp:View>
                <asp:View ID="View2" runat="server">
                    <div class="manager">
                        <asp:Panel ID="pnPayments" runat="server" GroupingText="Mục nhập thông tin hình thức thanh toán" ValidationGroup="Payments" >
                            <table>
                                <tr>
                                    <td>Mã hình thức thanh toán</td>
                                    <td><asp:TextBox ID="txtPaymentID" Width="130" runat="server" />
                                        <asp:RequiredFieldValidator ID="rfvPaymentID" runat="server" ControlToValidate="txtPaymentID" Display="Dynamic" ErrorMessage="Mã hình thức thanh toán không được rỗng" SetFocusOnError="True" ValidationGroup="Payments">*</asp:RequiredFieldValidator>
                                    </td>
                                    <td>Tên hình thức thanh toán</td>
                                    <td><asp:TextBox ID="txtPaymentName" Width="130" runat="server" />
                                        <asp:RequiredFieldValidator ID="rfvPaymentName" runat="server" ControlToValidate="txtPaymentName" Display="Dynamic" ErrorMessage="Tên hình thức thanh toán không được rỗng" SetFocusOnError="True" ValidationGroup="Payments">*</asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>Trạng thái</td>
                                    <td colspan="3" align="left">
                                        <asp:RadioButtonList ID="rbtnStatus_Payment" runat="server" RepeatDirection="Horizontal">
                                            <asp:ListItem Enabled="true" Selected="True" Text="Hiện" Value="1"></asp:ListItem>
                                            <asp:ListItem Text="Ẩn" Value="0" />
                                        </asp:RadioButtonList>
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel><br />
                        <asp:ValidationSummary ID="ValidationSummary2" runat="server"  ValidationGroup="Payments"/><br />
                        Chú ý: Phải nhập đầy đủ thông tin khách hàng khi thêm mới<br />
                        <span class="button-met dark"><asp:Button ID="btnInsert2" Text="Thêm Mới" runat="server" OnClick="btnInsert2_Click" CssClass="button" BorderWidth="0px" ValidationGroup="Payments" /></span>&nbsp;
                        <span class="button-met dark"><asp:Button ID="btnUpdate2" Text="Cập Nhật" runat="server" OnClick="btnUpdate2_Click" CssClass="button" BorderWidth="0px" ValidationGroup="Payments" /></span>
                        <br />
                        <br />
                        <asp:GridView ID="gvPayments" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" CellPadding="4" Width="947px" OnSelectedIndexChanging="gvPayments_SelectedIndexChanging" AllowPaging="true" OnPageIndexChanging="gvPayments_PageIndexChanging" OnRowDeleting="gvPayments_RowDeleting">
                            <Columns>
                                <asp:BoundField HeaderText="Mã HTTT" DataField="paymentid" />
                                <asp:BoundField HeaderText="Tên HTTT" DataField="paymentname" />
                                <asp:TemplateField HeaderText="Trạng Thái">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("status") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# ((Eval("status").ToString()=="True")?"Hiện":"Ẩn") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:CommandField SelectText="Sửa" ShowSelectButton="True" />
                                <asp:CommandField DeleteText="Xoá" ShowDeleteButton="True" />
                            </Columns>
                            <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
                            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
                            <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
                            <RowStyle BackColor="White" ForeColor="#330099" VerticalAlign="Top" />
                            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
                            <SortedAscendingCellStyle BackColor="#FEFCEB" />
                            <SortedAscendingHeaderStyle BackColor="#AF0101" />
                            <SortedDescendingCellStyle BackColor="#F6F0C0" />
                            <SortedDescendingHeaderStyle BackColor="#7E0000" />
                        </asp:GridView>
                    </div>
                </asp:View>
            </asp:MultiView>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

